package com.yc.game.cms.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yc.game.cms.dao.OrderMapper;
import com.yc.game.cms.pojo.Order;
import com.yc.game.cms.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    /**
     * 查询所有订单
     * @param pageNum
     * @param pageSize
     * @return
     */
    @Override
    public PageInfo<Order> getAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Order> orders = orderMapper.getAll();
        PageInfo<Order> pageInfo = new PageInfo<>(orders);
        return pageInfo;
    }
}
